<template>
	<view class="plan card record-content">
		<view class="title flex justify-between">
			<text>维修信息</text>
		</view>
		<view class="question">
			<view>
				<view class="grey1-color flex justify-start" style="margin-bottom: 12px" v-if="!taskInfo?.repairTeamName && !taskInfo?.repairTeamUserName && !taskInfo?.answerTime">
					待维修人员响应，暂无信息
				</view>
				<view class="record-item" v-show="taskInfo?.answerTime">
					<text>应答时间</text>
					<text>{{ taskInfo?.answerTime || '' }}</text>
				</view>
				<view class="record-item" v-show="taskInfo?.repairStartTime">
					<text>维修开始时间</text>
					<text>{{ taskInfo?.repairStartTime || '' }}</text>
				</view>
				<view class="record-item" v-show="taskInfo?.repairEndTime">
					<text>维修结束时间</text>
					<text>{{ taskInfo?.repairEndTime || '' }}</text>
				</view>
			<!-- 	<view class="record-item" v-show="taskInfo?.faultMode">
					<text>故障模式</text>
					<text>{{ taskInfo?.faultMode || '' }}</text>
				</view> -->
				<view class="record-item" v-show="taskInfo?.faultPosition">
					<text>故障部位</text>
					<text>{{ taskInfo?.faultPosition || '' }}</text>
				</view>
				<view class="record-item" v-show="taskInfo?.faultPhenomenon">
					<text>故障现象</text>
					<text>{{ taskInfo?.faultPhenomenon || '' }}</text>
				</view>
				<view class="record-item" v-show="taskInfo?.faultReason">
					<text>故障原因</text>
					<text>{{ taskInfo?.faultReason || '' }}</text>
				</view>
				<view class="record-item" v-show="taskInfo?.faultHandleMeasure">
					<text>故障处理措施</text>
					<text>{{ taskInfo?.faultHandleMeasure || '' }}</text>
				</view>
				<view class="record-item" v-show="taskInfo?.repairSituation">
					<text>维修情况说明</text>
					<text>{{ taskInfo?.repairSituation || '' }}</text>
				</view>
				<view class="record-item" v-show="taskInfo?.repairTeamName">
					<text>维修班组</text>
					<text>{{ taskInfo?.repairTeamName || '' }}</text>
				</view>
				<view class="record-item" v-show="taskInfo?.repairTeamUserName">
					<text>维修人</text>
					<text>{{ taskInfo?.repairTeamUserName || '' }}</text>
				</view>
				<view class="record-item" v-show="taskInfo?.outSourcing == '1'">
					<text>是否委外</text>
					<text>是</text>
				</view>
				<view class="record-item" v-show="taskInfo?.parts?.length">
					<text>备件更换</text>
					<text style="text-decoration: underline; color: #0379ff" @click="jumpUrl(`/pages/eam/equ/attachmentList/index?id=${taskInfo.id}&assetKind=${taskInfo.assetKind}`)">
						查看
					</text>
				</view>
				<view class="record-item" v-if="taskInfo?.executeFiles.length">
					<upload-image
						:keys="2"
						:multiple="false"
						:isRead="true"
						:accept="accept"
						camera="back"
						:list="taskInfo?.executeFiles"
						:capture="capture"
						style="margin-top: 9px"
						folderName="eam/equ/eamRepairHandle"
					></upload-image>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup name="RepairHandleInfo">
import UploadImage from '@/components/upload-image-ssr.vue';
const props = defineProps({
	taskInfo: {
		type: Object,
		default: () => {}
	}
});

const { taskInfo } = toRefs(props);

// 是否折叠
const isCollapse = ref(false);

// 摄像头参数设置
const capture = ref(["camera",'album']);
const accept = ref('image');

// 跳转至备件页面
function jumpUrl(url) {
	uni.navigateTo({
		url: url,
		fail: () => {
			uni.showToast({
				title: '敬请期待',
				icon: 'error'
			});
		}
	});
}
</script>

<style lang="scss" scoped>
.card {
	background-color: #fff;
	margin: 10px 10px;
	border-radius: 8px;
	padding: 12px 12px;
	transition: all 300ms ease;
	box-shadow: 0 2px 6px rgba(3, 121, 255, 0.05);
}
.title {
	font-size: 16px;
	margin: 6px 0 14px;
	font-weight: bold;
	.u-icon {
		margin-right: 3px;
	}
}
</style>
